package com.kk.poseidon.config.spring;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

import com.kk.poseidon.config.spring.extension.SpringExtensionFactory;

/**
* ServiceBean.java
* 类说明 TODO
*
* @author chengkai
* @date  2017年5月22日 上午11:13:19
*/
public class ServiceBean implements ApplicationContextAware, ApplicationListener {

    private ApplicationContext applicationContext;
    
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (ContextRefreshedEvent.class.getName().equals(event.getClass().getName())) {
            
        }
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
        SpringExtensionFactory.add(applicationContext);
    }

}
